package com.yihuan.service;

import com.yihuan.entity.CollectionRecycleEntity;
import com.yihuan.mapper.CollectionRecycleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author:梦醒
 * Date: 2022/5/5 17:00
 * Dream:
 * 信言不美，美言不信。
 * 善者不辩，辩者不善。
 * 知者不博，博者不知。
 * Function:
 */
@Service
public class CollectionRecycleService {
    @Resource
    CollectionRecycleMapper collectionRecycleMapper;
    
    
    /**
     * 注册废品收藏信息
     *
     * @param collectionRecycleEntity
     * @return
     */
    public int insertCollectionRecycleByCollectionRecycleData(CollectionRecycleEntity collectionRecycleEntity) {
        return collectionRecycleMapper.insertCollectionRecycleByCollectionRecycleData(collectionRecycleEntity);
    }
    
    /**
     * 查询废品收藏信息是否已存在过
     *
     * @param collectionRecycleEntity
     * @return
     */
    public List<CollectionRecycleEntity> findCollectionRecycleByCollectionRecycleByID(CollectionRecycleEntity collectionRecycleEntity) {
        return collectionRecycleMapper.findCollectionRecycleByCollectionRecycleByID(collectionRecycleEntity);
    }
    
    
    /**
     * 查询用户收藏
     *
     * @param collectionRecycleEntity
     * @return
     */
    public List<CollectionRecycleEntity> findCollectionRecycleByCollectionRecycle(CollectionRecycleEntity collectionRecycleEntity) {
        return collectionRecycleMapper.findCollectionRecycleByCollectionRecycle(collectionRecycleEntity);
    }
    
    
    /**
     * 取消收藏
     *
     * @param collectionRecycleEntity
     * @return
     */
    public int updateCollectionRecycleByCollectionRecycle(CollectionRecycleEntity collectionRecycleEntity) {
        return collectionRecycleMapper.updateCollectionRecycleByCollectionRecycle(collectionRecycleEntity);
    }
    
    
}
